﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Lister;
using NUnit.Framework;
using COFE.Core.Entry;

namespace COFE.Core.Profile
{
    [Flags]
    public enum EntryConstructionFlags : int
    {
        None = 1 << 0,
        LookupIfParseFailed = 1 << 1,  //Lookup if parse failed.
        ConvertEntry = 1 << 2,
        EnableCache = 1 << 3, //Enable cache by default if available.
        VolumeKeyNotDefined = 1 << 4, //The Lister Key is not defined in parse path.

        Default = ConvertEntry | EnableCache,
        DefaultWithLookup = ConvertEntry | EnableCache | LookupIfParseFailed,        
        DefaultWithoutCache = ConvertEntry,
        DefaultWithoutCacheWithLookup = ConvertEntry | LookupIfParseFailed,
    }

    public interface IEntryConstructor
    {
        /// <summary>
        /// This is used to construct a FileInfoExA
        /// Ignored ConvertEntry flags, if require call CreateEntry() method instead.
        /// </summary>
        /// <param name="primPropProvider">Either Primary Property Provider (IPropertyProvider) or a Cache (IPropertyProviderCache).</param>
        /// <returns></returns>
        IInternalFileInfoExA CreateFile(string listerKey, IPropertyProvider propProvider,
            EntryConstructionFlags flags = EntryConstructionFlags.Default);

        /// <summary>
        /// This is used to construct a DirectoryInfoExA.  
        /// Ignored ConvertEntry flags, if require call CreateEntry() method instead.
        /// </summary>
        /// <param name="primPropProvider">Either Primary Property Provider (IPropertyProvider) or a Cache (IPropertyProviderCache).</param>
        /// <returns></returns>
        IInternalDirectoryInfoExA CreateDirectory(string listerKey, IPropertyProvider propProvider,
            EntryConstructionFlags flags = EntryConstructionFlags.Default);
    }


}
